package com.kcsoft.welcome.mapper;

import com.kcsoft.welcome.pojo.NewMem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Mapper
public interface NewMemMapper {

    @Insert("insert into newmem (name, pr, class, xueyuan, phone) values" +
            "(#{name}, #{pr}, #{cla}, #{xueyuan}, #{phone})")
    void add(NewMem newMem);


    @Select("select * from newmem")
    List<NewMem> list();

    @Delete("truncate table newmem")
    void deleteAll();
}
